﻿using System.Linq;
using CodeContrib.Collections.Generic;

namespace CodeContrib
{
	public static class QueryableExtensions
	{
		public static Paged<T> ToPaged<T>(this IQueryable<T> query, int pageNumber, int pageSize)
		{
			return new Paged<T>(query, pageNumber, pageSize);
		}

		public static Paged<T> ToPaged<T>(this IQueryable<T> query, Paging paging)
		{
			return ToPaged(query, paging.PageNumber, paging.PageSize);
		}
	}
}